package com.jungle.bfi.generator.config;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.nio.file.Path;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class PositionCfg {
    /**
     * 工作空间
     */
    private String workspace;
    /**
     * 工程
     */
    private String project;
    /**
     * 模块
     */
    private String module;
    /**
     * 源代码
     */
    private String source;
    /**
     * 资源
     */
    private String resource;
    /**
     * 资源类型
     */
    private SourceType sourceType;

    public Path getBasePath() {
        return Path.of(workspace, project, module, sourceType == SourceType.RESOURCES ? resource : source);
    }
}
